package cn.cs.mapper;

import cn.cs.pojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface RepairUserMapper {

    public RepairUser getRepairUserById(@Param(value = "id") String id) throws Exception;

    /**
     * 根据用户手机号查询用户信息
     * @param phone 用户手机号
     * @return 对应phone的用户
     * @throws Exception
     */
    public RepairUser getUserByPhone(@Param(value = "phone") String phone) throws Exception;
    /**
     * 查询证件类型
     * @param param 查询证件类型
     * @return 证件类型列表
     * @throws Exception
     */
    public List<Map<String,Object>> getCerListByTypes(Map<String, Object> param);
    /**
     * 插入证件类型
     * @param repImg 证件类型
     * @return
     * @throws Exception
     */
    public int insertRepairCertificateImg(RepairCertificateImg repImg);

    public int checkIdCardNum(String idCard);

    public int insertRepairUser(RepairUser user);

    public  int insertRepAreas(RepairUserArea repairUserArea);

    public int updateRepairUser(RepairUser newUser);

    public RepairUser getRepairUserByPhone(String phone);

    public List<RepairCertificateImg> getRepairCerfImgs(String id);

    public  int deleteRepairAreaById(String id);

    public int checkInvitationCode(String invitationCode);

    public List<ClientUser> getMypriLciById(String id);

    public RepairUserComplaint getComplaintById(String id);

    public List<RepairUserComplaintNote> getMyComplaintNodes(String id);

    public List<RepairUserComplaint> getMyComplaint(String id);

    public String getCerfImgPath(RepairCertificateImg repImg);

    public int updateCertificateImgs(RepairCertificateImg repImg);

    public List<Map<String,Object>> getPolicy();

    public RepSettlement getLastSettlement(String id);

    public int insertSettOrder(SettlementOrder settlementOrder);

    public int insertSett(RepSettlement repSettlement);

    public List<Map<String,Object>> getRepairUserArea(String id);

    public Map<String,Object> getRepairUserByUserId(@Param(value = "userId") String userId)throws Exception;

    public List<ServiceType> getServiceTypeList();

    public List<FaultType> getFaultTypeByParentId(Map<String, Object> param);

    public List<Map<String, Object>> getCertificateImgByUserId(@Param(value = "rep_user_id") String rep_user_id);

    public List<Map<String, Object>> getCertificateListByFaultId(@Param(value = "fault_id") String fault_id);

    public Map getVersion(String type);

    public void insertRepairCertificateImg(Map<String, Object> repImg);

    public void updateCertificateImgs(Map<String, Object> repImg);

    public String getCerfImgPath(Map<String, Object> repImg);

    public int insertCertificateList(Map<String, Object> param);

    public int delCertificateImg(@Param(value = "id") String id);

    public List<Map<String, Object>> getRepairUserDayByMap(Map<String, Object> param);

    public Integer getRepairUserDayCountByMap(Map<String, Object> param);


    public void insertClientRepRel(Map<String,Object> map)throws Exception;

    public Map<String,Object> getrepEvaluateById(String repUserId)throws Exception;

    public Map<String,Object> getRepairUserInfoById(String repUserId)throws Exception;

    public Map<String,Object> getloveCountAndOrderCount(@Param(value = "repUserId") String repUserId)throws Exception;

    public Map<String,Object> getRepairUserFaultTypeById(String repUserId)throws Exception;

    public RepairUser getRepairUserById(@Param(value = "id") Long id)throws Exception;

    public List<RepairUser>	getRepairUserListByMap(Map<String, Object> param);

    public Integer getRepairUserCountByMap(Map<String, Object> param);

    public Integer deleteRepairUserById(@Param(value = "id") Long id)throws Exception;

    public  RepairUser getRepByAccount(String name)throws Exception;

    public void insertSett(Map<String, Object> settMap);

    public void insertSettOrder(Map<String, Object> settOrderMap);

    public List<Map<String,Object>> getOrdersByDate(Map<String, Object> param);

    public Map<String,Object> getRepBalance(String id);

    public void insertRepBalance(Map<String, Object> map);

    public List<Map<String,Object>> getMySettlement(Map<String,Object> map);

    public List<Map<String,Object>> getCountSettlement(Map<String, Object> map);

    public int getUserCountByAccount(String account);

    public int getUserCountByPhone(String phone);

    public List<Map<String,Object>> getRepairUserByAreaId(@Param(value = "area") String area)throws Exception;

    public FaultType getFaultTypeByOnlyId(@Param(value = "id") String id)throws Exception;

    public void updateRepOrderIsAppset(Map<String, Object> orderMap);

    public String getMyEarningsToday(Map<String, Object> param);

    public String getAllEarnByUserId(String id);

    public Map<String,Object> getMyInfoById(String id);

    public Map<String,Object> getMyEvaluateByOrderId(String id);

    public List<Map<String,Object>> getFaultType(String id);

    public List<Map<String,Object>> getServiceType();

    public void insertRepAreas(Map<String, Object> map);

    public Integer insertRepairUserAreaList(@Param(value = "list") List<Map<String, Object>> list);

    public Integer updateUserOrderNumber(@Param(value="id") String id)throws Exception;

    public Map<String,Object> getRepairUserAddressByAreaId(@Param(value = "repairUserId") String repairUserId, @Param(value = "area") String area)throws Exception;

    public List<Map<String, Object>> getRepairUserByLikePhone(@Param(value="phone") String phone, @Param(value="personName") String personName)throws Exception;

    public Long getUserNumberByAgentCode(@Param(value = "invitationCode") String invitationCode) throws Exception;

    public Map<String, String> getRepairAddressById(@Param(value = "rep_user_id") String rep_user_id, @Param(value = "address") String address)throws Exception;
}
